﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MembersManager.ascx.cs"
    Inherits="CMS.Controls.Members.MembersManager" %>
<%@ Import Namespace="Core.Library" %>
<%@ Import Namespace="DataObject.Members" %>
<asp:HiddenField ID="hfTab" runat="server" />
<asp:HiddenField ID="hfRound" ClientIDMode="Static" runat="server" />
<asp:HiddenField ID="hfStatus" runat="server" />
<div class="stats">
    <ul>
        <li class="w10p"><a title="" class="count green" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberRound.Round3.ToString()) %>">
            <%= Round3 %></a><span>Vòng 3</span></li>
        <li class="w10p"><a title="" class="count green" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberRound.Round2.ToString()) %>">
            <%= Round2 %></a><span>Vòng 2</span></li>
        <li class="w10p"><a title="" class="count green" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberRound.Round1.ToString()) %>">
            <%= Round1 %></a><span>Vòng 1</span></li>
        <li class="w10p"><a title="" class="count green" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberStatus.IsPublished.ToString()) %>">
            <%= Publish %></a><span>Đã duyệt</span></li>
        <li class="w10p"><a title="" class="count orange" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberStatus.IsWaitingForPublish.ToString()) %>">
            <%= WaitingForPublish %></a><span>Chờ duyệt</span></li>
        <li class="w10p last"><a title="" class="count red" href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberStatus.IsRemoved.ToString()) %>">
            <%= Removed %></a><span>Đã gỡ</span></li>
    </ul>
    <div class="fix">
    </div>
</div>
<!-- /stats --

<asp:Literal ID="ltMessage" runat="server"/>
<!-- /message -->
<div class="widget" style="margin-top: 20px">
    <ul class="tabs">
        <li id="tab33"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberRound.Round3.ToString()) %>">
            Vòng 3</a></li>
        <li id="tab22"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberRound.Round2.ToString()) %>">
            Vòng 2</a></li>
        <li id="tab11"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberRound.Round1.ToString()) %>">
            Vòng 1</a></li>
        <li id="tab8"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberStatus.IsPublished.ToString()) %>">
            Đã duyệt</a></li>
        <li id="tab2"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberStatus.IsWaitingForPublish.ToString()) %>">
            Chờ duyệt</a></li>
        <li id="tab16"><a href="<%= UrlHelpers.ListTab(cControl.AdminMenuId, MemberStatus.IsRemoved.ToString()) %>">
            Đã gỡ</a></li>
    </ul>
    <div class="tab_container">
        <div class="tab_content">
            <div class="floatleft">
                <div class="searchWidget">
                    <input id="txtKName" type="text" placeholder="Tên đầy đủ" style="width: 200px; height: 20px"
                        runat="server" />
                    <input id="txtKEmail" type="text" placeholder="Email" style="width: 200px; height: 20px"
                        runat="server" />
                    <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" />
                </div>
            </div>
            <div class="floatright">
                <asp:Button ID="btnRound3" Text="Lên vòng 3" ClientIDMode="Static" Visible="false"
                    CssClass="basicBtn mb15 ml5 seaBtn" OnClick="BtnRound3" runat="server" />
                <asp:Button ID="btnRound2" Text="Lên vòng 2" ClientIDMode="Static" Visible="false"
                    CssClass="basicBtn mb15 ml5 seaBtn" OnClick="BtnRound2" runat="server" />
                <asp:Button ID="btnRound1" Text="Lên vòng 1" ClientIDMode="Static" Visible="false"
                    CssClass="basicBtn mb15 ml5 seaBtn" OnClick="BtnRound1" runat="server" />
                <asp:Button ID="btnPublish" Text="Duyệt" ClientIDMode="Static" Visible="false" CssClass="basicBtn mb15 ml5 seaBtn"
                    OnClick="BtnPublish" runat="server" />
                <asp:Button ID="btnRemove" Text="Gỡ bài" ClientIDMode="Static" Visible="false" CssClass="basicBtn mb15 ml5 redBtn"
                    OnClick="BtnRemove" runat="server" />
                <asp:Button ID="btnRestore" Text="Phục hồi" ClientIDMode="Static" Visible="false"
                    CssClass="basicBtn mb15 ml5 seaBtn" OnClick="BtnRestore" runat="server" />
                <asp:Button ID="btnDelete" Text="Xóa bài" ClientIDMode="Static" Visible="false" CssClass="basicBtn mb15 ml5 redBtn"
                    OnClick="BtnDelete" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?');"
                    runat="server" />
            </div>
            <div class="fix">
            </div>
<%--            <div class="pics">
                <ul>
                    <asp:ListView ID="lvList" DataKeyNames="Member_ID" OnItemDataBound="lvList_ItemDataBound" runat="server">
                        <ItemTemplate>
                            <li class="topDir" title="<%# ((MembersObject)Container.DataItem).Member_FullName %>">
                                <a target="_blank" href="<%# UrlHelpers.MembersDetails(((MembersObject)Container.DataItem).Member_ID, ((MembersObject)Container.DataItem).Member_Email, 1) %>">
                                    <img width="120px;" height="120px;" src="<%# StorageAPI.Zoom(120, 120,((MembersObject)Container.DataItem).Member_AvataMini) %>"
                                        alt="<%# ((MembersObject)Container.DataItem).Member_FullName %>" /></a>
                                <div class="actions">
                                <asp:PlaceHolder ID="phVote1" Visible="false" runat="server">
                                    <span>Vote: <%# ((MembersObject)Container.DataItem).Vote1 %></span>
                                </asp:PlaceHolder>
                                <asp:PlaceHolder ID="phVote2" Visible="false" runat="server">
                                    <span>Vote: <%# ((MembersObject)Container.DataItem).Vote2 %></span>
                                </asp:PlaceHolder>
                                <asp:PlaceHolder ID="phVote3" Visible="false" runat="server">
                                    <span>Vote: <%# ((MembersObject)Container.DataItem).Vote2 %></span>
                                </asp:PlaceHolder>
                                <asp:CheckBox ID="cbItem" ClientIDMode="Static" runat="server" />
                                <a class="topDir" title="Sửa" href="<%# UrlHelpers.EditMembers(((MembersObject)Container.DataItem).Member_ID.ToString(), Url) %>">
                                        <img src="/images/icons/dark/edit.png" alt="" /></a>
                                </div>
                            </li>
                        </ItemTemplate>
                        <EmptyDataTemplate>
                            <div style="width: 99%; margin: auto; padding-top: 5px;">
                                <%= MessageUtility.NoData %></div>
                        </EmptyDataTemplate>
                    </asp:ListView>
                </ul>
                <div class="fix">
                </div>
            </div>--%>
            <!-- /list -->
            <asp:ListView ID="lvList" DataKeyNames="Member_ID" OnItemDataBound="lvList_ItemDataBound"
                runat="server">
                <LayoutTemplate>
                    <div class="widget" style="margin-top: 10px">
                        <table id="grdList" width="100%" cellspacing="0" cellpadding="0" class="tableStatic">
                            <thead>
                                <tr>
                                    <td class="pl10 w30">
                                        <input id="cbAll" type="checkbox" onclick="selectAllRows(this);" />
                                    </td>
                                    <td class="w45">
                                        STT
                                    </td>
                                    <td class="w120">
                                        Avatar
                                    </td>
                                    <td class="w140">
                                        Thông tin
                                    </td>
                                    <td>Album ảnh</td>
                                    <td class="w60">
                                        Vote
                                    </td>
                                    <td class="w60">
                                        Slide
                                    </td>
                                    <td class="w100">
                                        Thao tác
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr id="itemPlaceHolder" runat="server">
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr id="<%# ((MembersObject)Container.DataItem).Member_ID %>-list">
                        <td class="aligncenter">
                            <asp:CheckBox ID="cbItem" ClientIDMode="Static" runat="server" />
                        </td>
                        <td class="aligncenter">
                            <%# Utils.GetStt(ConvertUtility.ConvertTo<int>(Container.DataItemIndex), PageIndex, PageSize)%>
                        </td>
                         <td>
                            <a target="_blank" href="<%# UrlHelpers.MembersDetails(((MembersObject)Container.DataItem).Member_ID, ((MembersObject)Container.DataItem).Member_Email, ((MembersObject)Container.DataItem).Member_InRound) %>">
                                <img width="120px;" height="120px;" src="<%# StorageAPI.Zoom(120, 120,((MembersObject)Container.DataItem).Member_Avatar) %>"
                                    alt="<%# ((MembersObject)Container.DataItem).Member_FullName %>" /></a>
                        </td>
                        <td class="" style="color: Gray">
                            Tên đầy đủ:<b style="color: white"> <%# ((MembersObject)Container.DataItem).Member_FullName %></b><br />
                            Username:<b style="color: white"> <%# ((MembersObject)Container.DataItem).Member_Name %></b><br />
                            Email:<b style="color: white"> <%# ((MembersObject)Container.DataItem).Member_Email %></b><br />
                            Ngày sinh:<b style="color: white"> <%# DateTimeFunctions.FormatIn_DDMMYYYY(((MembersObject)Container.DataItem).Member_Birthday) %></b><br />
                            Số điện thoại:<b style="color: white"> <%# ((MembersObject)Container.DataItem).Member_Tel %></b><br />
                            Địa chỉ:<b style="color: white"> <%# ((MembersObject)Container.DataItem).Member_Address %></b>
                        </td>
                        <td>
                        <div class="member-album" ref="<%# ((MembersObject)Container.DataItem).Member_ID %>"></div>
                        </td>
                        <td class="aligncenter">
                                <asp:PlaceHolder ID="phVote1" Visible="false" runat="server">
                                    <span><%# ((MembersObject)Container.DataItem).Vote1 %></span>
                                </asp:PlaceHolder>
                                <asp:PlaceHolder ID="phVote2" Visible="false" runat="server">
                                    <span><%# ((MembersObject)Container.DataItem).Vote2 %></span>
                                </asp:PlaceHolder>
                                <asp:PlaceHolder ID="phVote3" Visible="false" runat="server">
                                    <span><%# ((MembersObject)Container.DataItem).Vote3 %></span>
                                </asp:PlaceHolder>                        
                        </td>
                        <td class="aligncenter">
                            <asp:Literal ID="ltIsSlide" runat="server" />
                        </td>
                        <td class="aligncenter">
                            <asp:Literal ID="ltImage" runat="server" />
                            <a class="btn14 topDir" title="Sửa" href="<%# UrlHelpers.EditMembers(((MembersObject)Container.DataItem).Member_ID.ToString(), Url) %>">
                                <img src="/images/icons/dark/pencil.png" alt="" />
                            </a>
                        </td>
                    </tr>
                    <asp:HiddenField ID="hfIsSlide" Value='<%# ((MembersObject)Container.DataItem).Member_IsSlide %>' runat="server"/>
                    <asp:HiddenField ID="hfIsHomePage" Value='<%# ((MembersObject)Container.DataItem).Member_HomePageFocus %>' runat="server"/>
                    <asp:HiddenField ID="hfMemberId" Value='<%# ((MembersObject)Container.DataItem).Member_ID %>' runat="server"/>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <div style="width: 99%; margin: auto; padding-top: 5px;">
                        <%= MessageUtility.NoData %></div>
                </EmptyDataTemplate>
            </asp:ListView>
            <!-- /list -->
            <div class="body clear mb22">
                <div class="floatleft">
                    <label>
                        Số bản ghi / trang:</label>
                    <asp:DropDownList ID="ddlPageSize" runat="server" Width="60" AutoPostBack="True"
                        OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
                        <asp:ListItem Text="20" Value="20" />
                        <asp:ListItem Text="40" Value="40" />
                        <asp:ListItem Text="60" Value="60" />
                        <asp:ListItem Text="80" Value="80" />
                        <asp:ListItem Text="100" Value="100" />
                    </asp:DropDownList>
                </div>
                <div class="pagination floatright">
                    <ul class="pages">
                        <asp:Literal ID="ltPager" runat="server" />
                    </ul>
                </div>
            </div>
            <div class="fix">
            </div>
            <!-- /pager -->
        </div>
    </div>
    <div class="fix">
    </div>
</div>
<!-- /tabs two zodiac -->
<script type="text/javascript">
    setTimeout(function() {
        var round = $('#hfRound').val();
        if (round > 0) {
            $('#grdList tbody tr').each(function () {
                var id = $(this).find('.member-album').attr('ref');
                bindMemberAlbum($(this).find('.member-album'), id, round);
            });
        }        
    }, 1000);
    activeTab('<%= Tab %>');
</script>
